//
//  YDUserSettingViewController.m
//  IngCard
//
//  Created by kf on 2017/8/9.
//  Copyright © 2017年 IngDan. All rights reserved.
//

#import "YDUserSettingViewController.h"
#import "YDUserSettingTableViewCell.h"
#import "YDUserLogoutTableViewCell.h"
#import "YDAccountManager.h"

@implementation YDUserSettingViewController

- (void) initSubviews
{
    [super initSubviews];
    self.title = @"设置";
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}

- (void) viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [THEME renderStatusBarStyle:YDStatusBarStyle_Dark];
    [THEME renderNavigationBar:self style:YDNavigationStyle_Gray];
}

- (void) viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear: animated];
    
    [THEME renderStatusBarStyle:YDStatusBarStyle_Light];
}

-(void) initDataSource
{
    [super initDataSource];
    
    [self.dataSource addDataSource:[YDUserSettingCellDataSource class]
                         atSection:0
                            config:^(YDUserSettingCellDataSource* dataSource)
    {
        dataSource.height = 80;
        dataSource.title = @"通用";
    }];
    
    
    [self.dataSource addDataSource:[YDUserSettingCellDataSource class]
                         atSection:0
                            config:^(YDUserSettingCellDataSource* dataSource)
     {
         dataSource.title = @"通知设置";
     }];
    
    
    [self.dataSource addDataSource:[YDUserSettingCellDataSource class]
                         atSection:0
                            config:^(YDUserSettingCellDataSource* dataSource)
     {
         dataSource.title = @"隐私设置";
     }];
    
    
    [self.dataSource addDataSource:[YDUserSettingCellDataSource class]
                         atSection:0
                            config:^(YDUserSettingCellDataSource* dataSource)
     {
         dataSource.height = 66;
         dataSource.title = @"清空缓存";
     }];
    
    
    [self.dataSource addDataSource:[YDUserSettingCellDataSource class]
                         atSection:0
                            config:^(YDUserSettingCellDataSource* dataSource)
     {
         dataSource.title = @"关于";
     }];
    
    
    [self.dataSource addDataSource:[YDUserLogoutCellDataSource class]
                         atSection:0
                            config:^(YDUserLogoutCellDataSource* dataSource)
    {
//        dataSource.tag = 11;
    }];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}

@end
